Bayes Theorem
Suppose a sample space S is a union of mutually disjoint events B1, B2, B3, Á , Bn, suppose A is an event in S, and suppose both A and each Bk have nonzero probabilities for every integer k with 1 $\le$ k $\le$ n. Then
$$ P(B_k | A)=\frac{P(A | B_k)P(B_k)}{P(A | B_1)P(B_1)+P(A|B_2)P(B_2)+\dots+P(A|B_n)P(B_n)} $$